<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<%--流程图表--%>
<%--<div id="flowChart" style="width: 860px;height: 400px;margin:30px 0;"></div>--%>
<form:form commandName="task" cssClass="form-horizontal" role="form" onsubmit="return false;">
    <h3 style="margin: 0px 0px 10px 0;">当前项目详情</h3>
    <div class="form-group">
        <div class="col-sm-12">
            <textarea rows="2" id="projectDetail" name="taskContent" placeholder="项目详情（主要问题）" readonly
                      class="form-control ">${projectDetail}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right">攻坚计划开始时间</label>
        <div class="col-sm-4">
            <input type="text" id="planStartDate" value="${task.planStartDate}" class="form-control" readonly>
        </div>
        <label class="col-sm-2 control-label no-padding-right" for="tackFlag">攻坚计划结束时间</label>
        <div class="col-sm-3">
            <input type="text" id="planEndDate" value="${task.planEndDate}" class="form-control" readonly>
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right">当前情况</label>
        <div class="col-sm-4">
            <input type="text" id="result" value="" class="form-control" readonly>
        </div>
        <label class="col-sm-2 control-label no-padding-right" for="tackFlag">审核结果</label>
        <div class="col-sm-3">
            <select name="tackFlag" id="tackFlag" class="form-control">
                <option value="">--请选择--</option>
                <option value="1">审核不通过</option>
                <option value="3">审核通过</option>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right">审核备注</label>
        <div class="col-sm-9">
            <textarea rows="1" id="approvalTackText" name="approvalTackText"
                      class="form-control "></textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right">办结时间</label>
        <div class="col-sm-4">
            <input type="text" id="finishTackDate" value="${finishTackDate}" name="finishTackDate" class="form-control"
                   readonly>
        </div>
        <div class="col-sm-4 pull-right">
            <button class="col-sm-5 btn btn-large btn-warning" id="submit">确认审核</button>
        </div>
    </div>
    <input hidden name="finishTactText" id="finishTactText"/>
    <form:hidden path="sysId"/>
</form:form>
<hr width="100%;height:2px;">
<div class="row" style="margin-left: 2px;">
    * 以上按住如此标志：<img src="/assets/web/img/zzc.png" alt="提示"/>可拖动调整相应输入框大小
</div>
<script src="<s:url value="/assets/js/ajaxfileupload.js"></s:url>"></script>
<script type="text/javascript">
    var tackFlag = ${task.tackFlag};
    if (tackFlag == "1") {
        $("#result").val("未办结");
    } else if (tackFlag == "2") {
        $("#result").val("已确认办结，审核中");
    } else {
        $("#result").val("已办结");
    }

    $("#submit").click(function () {
        var tackFlag = $("#tackFlag").val();
        if(tackFlag == ""){
            alert("请选择审核结果！");
            return false;
        }
        executeSaveOrUpdate({
            formId: "#formDialog form",
            dialogId: "#formDialog",
            url: getUrl("approval"),
            tableId: "#gridTable",
            successMessage: "审核完成",
            successTitle: '保存对话框',
            //failMessage: '保存失败',
            failTitle: '消息对话框'
        });
        //倒计时
        var btn = document.getElementById("submit");
        btn.disabled = true
        countdown(5);
        window.location.href = "/taskToTack";
    })
</script>